<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    <div>看控制台输出</div>

    <script>
        let arr = [1,2,3,4,5]
        let id = "2"
        let newArr = arr.filter(el=> {
            return el == id
        })
    console.log(newArr);


    console.log('-------------');

    let newArr2 = arr.findIndex(el=> {
            return el == id
        })
    console.log(newArr2);
    </script>
</body>
</html>